package com.sh.data.engine.domain.integration.api.webservice.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.sh.data.engine.domain.base.model.PageResult;
import com.sh.data.engine.domain.integration.api.taskconfig.model.domain.TaskItemDomain;
import com.sh.data.engine.domain.integration.api.taskconfig.model.param.PreviewExpressParam;
import com.sh.data.engine.domain.integration.api.taskconfig.model.param.TaskConfigParam;
import com.sh.data.engine.domain.integration.api.taskconfig.service.TaskConfigService;
import com.sh.data.engine.domain.integration.api.webservice.model.domain.GetServiceDomain;
import com.sh.data.engine.domain.integration.api.webservice.model.domain.TaskDomain;
import com.sh.data.engine.domain.integration.api.webservice.model.domain.TaskOverviewDomain;
import com.sh.data.engine.domain.integration.api.webservice.model.domain.TestApiHttpDomain;
import com.sh.data.engine.domain.integration.api.webservice.model.param.GetServiceParam;
import com.sh.data.engine.domain.integration.api.webservice.model.param.TestApiWsParam;
import com.sh.data.engine.repository.dao.integration.api.webservice.entity.ApiWsEntity;

import java.util.List;
import java.util.Map;

/**
 * @author : changkong
 * @date : 2022/3/11
 */
public interface ApiWsService extends TaskConfigService, IService<ApiWsEntity> {
    TestApiHttpDomain testApi(TestApiWsParam testApiWsParam);

    TaskOverviewDomain getOverview(Long projectId);

    PageResult<TaskItemDomain> getTaskPage(
        Integer pageNum, Integer pageSize, Integer status, String search);

    void save(
        Long id,
        String taskName,
        TestApiWsParam testApiWsParam,
        PreviewExpressParam previewParam,
        TaskConfigParam task);

    Integer generateJobId(ApiWsEntity apiWsEntity, TaskConfigParam task);

    TaskDomain getTaskById(Long taskId);

    GetServiceDomain getWsdlPortsAndMethods(GetServiceParam getServiceParam);

    Long getApiIdByXxlId(long jobId);

    void delete(Long id);

    Long run(Long taskId);

    void updateAfterStart(Long id);

    void updateAfterStop(Long logId, Integer status);

    List<TaskDomain> getListByPage(Long projectId, Integer pageSize, Integer pageNum);

    List<ApiWsEntity> getApiTaskByProjectId(Long projectId);

    String buildApiDataxJson(Long id, Map<String, String> param);
}
